import configparser
import os


# 对象初始化
class Conf:
    def __init__(self):
        self.conf = configparser.ConfigParser()
        self.root_path = os.path.dirname(os.path.abspath(__file__))
        self.f = os.path.join(self.root_path + "/config.conf")
        self.conf.read(self.f)

    # 获取所有的sections
    def read_sections(self):
        print(f"1、获取所有的sections:{self.conf.sections()}")


if __name__ == "__main__":
    aa = Conf()
    aa.read_sections()
